<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .root{
            width: 600px;
            height: 600px;
            display: grid;

            grid-template-rows: 200px 180px 180px 180px;
            grid-template-columns: 200px 180px 180px 180px;

            /* 通过row-gap和column-gap可以设置行列之间的间距。也可以通过复合属性gap来一同设置。gap: 行间距 列间距 */
            row-gap: 20px;
            column-gap: 20px;
            border: 1px solid gray;
        }
        .item{
            border: 1px solid red;
        }
    </style>
</head>
<body>
    <div class="root">
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
    </div>
</body>
</html>